import { electronHttp } from "../../utils/http/electron-http"
import { withLoading } from "../../utils/http/http"
// 获取本地的接口
const baseURL = import.meta.env.VITE_BASE_API_URL as string
// 创建设备
export function createDevice(params: any, headers?: any) {
  return withLoading(() =>
    electronHttp.post(baseURL + `/admin-api/conduct/device/create`, params, { headers: headers })
  )
}
// 删除设备
export function deleteDevice(params: any, headers?: any) {
  return withLoading(() =>
    electronHttp.delete(baseURL + `/admin-api/conduct/device/delete?id=${params.id}`, { headers: headers })
  )
}
// 获取设备列表接口
export function getDeviceList(params: any, headers?: any) {
  return withLoading(() =>
    electronHttp.get(baseURL + `/admin-api/conduct/device/account-list?pageNo=${params.pageNo}&pageSize=${params.pageSize}&deviceTypeName=${params.deviceTypeName}`, { headers: headers })
  )
}

